<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import AudioPlayer from './components/AudioPlayer.vue'

const route = useRoute()

// 计算属性：判断当前是否在认证页面（登录或注册）
const isAuthPage = computed(() => {
  return route.path === '/login' || route.path === '/register'
})
</script>

<template>
  <div id="app">
    <router-view />
    <!-- 只在非登录/注册页面显示播放器 -->
    <AudioPlayer v-if="!isAuthPage" />
  </div>
</template>

<style>
/* 全局样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #333;
  background-color: #f5f5f5;
}

/* #app {
  padding-bottom: 50px;
} */

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4 {
  margin-bottom: 15px;
}

/* 主题色变量，便于统一管理 */
:root {
  --primary-color: #c20c0c;
  --primary-hover: #e41818;
  --primary-active: #a60a0a;
}
</style>
